# $Id$
# Maintainer : Allan McRae <allan@archlinux.org>
# Contributor: Aaron Griffin <aaron@archlinux.org>

pkgname=fakechroot
pkgver=2.19
pkgrel=1
pkgdesc="Gives a fake chroot environment"
arch=('i686' 'x86_64')
url="https://github.com/dex4er/fakechroot/wiki"
license=('LGPL')
install=fakechroot.install
source=($pkgname-$pkgver.tar.gz::https://github.com/dex4er/fakechroot/archive/${pkgver}.tar.gz)
md5sums=('db6378420c769232e69508bb78612c34')


build() {
  cd ${srcdir}/${pkgname}-${pkgver}
  ./configure --prefix=/usr --sbindir=/usr/bin \
    --libdir=/usr/lib/libfakeroot --sysconfdir=/etc
  make
}

check() {
  cd ${srcdir}/${pkgname}-${pkgver}

  # t/fts.t fails when building on BTRFS...  (really!)
  make -k check || true
}
  
package() {
  cd ${srcdir}/${pkgname}-${pkgver}
  make DESTDIR=${pkgdir} install
  
  install -dm755 ${pkgdir}/etc/ld.so.conf.d/
  echo '/usr/lib/libfakeroot/fakechroot/' > ${pkgdir}/etc/ld.so.conf.d/fakechroot.conf
}
